// pages/my/my-add-address/index.js
var app = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {
    addressMenuIsShow: false,
    value: [0, 0, 0],
    consigneeName: "", 
    phone: "",
    detailedAddress: "",
    labelDefault: 0,              // 标签默认,
 
    
  },
  
  consigneeNameInput: function(e) {
    this.setData({
      consigneeName: e.detail.value
    })
  },
  phoneInput: function(e) {
    
    this.setData({
      phone: e.detail.value
    })
  },
  detailedAddressInput: function (e) {
    this.setData({
      detailedAddress: e.detail.value
    })
  },
  submit: function() {
    var consigneeName = this.data.consigneeName;
    console.log(consigneeName)
    var phone = this.data.phone;
    console.log(phone)
    var detailedAddress = this.data.detailedAddress
    console.log(detailedAddress)
    if (consigneeName == "") {
      wx: wx.showToast({
        title: '请输入姓名',
        image: "/images/待评价.png"
      })
      return false
    }
    else if (phone == "") {
      wx: wx.showToast({
        title: '请输入手机号码',
        image: "/images/待发货.png"
      })
      return false
    }
    else if (detailedAddress == "") {
      wx: wx.showToast({
        title: '请输入详细地址',
        image: "/images/售后记录.png"
      })
      return false
    }
    else {
      var a=consigneeName;
      var b=phone;
      var c=detailedAddress;
      wx.navigateTo({
        url: '/pages/adress/adress?yourName='+a+'&addr='+c+'&telephone='+b,
      })
    }
  },
  onShow: function () {
    var animation = wx.createAnimation({
      duration: 500,
      timingFunction: 'linear',
    })
    this.animation = animation
  },
 
})